@extends('admin.layout.common')
@section('content')
    <link rel="stylesheet" href="{{url('/css/finance/costing.css')}}">
    <link rel="stylesheet" href="{{url('/css/app.css')}}">
    <div class="content">
        <h1 class="h1">成本记账中心-仅未分账</h1>
        <!-- 公共结束 -->
        <p>
            <button type="button" value="" class="add_costing" style="margin-right:30px;">添加成本</button>
        </p>
        <div class="table-box">
            <table border="1">
                <tr>
                    <th>成本ID</th>
                    <th>成本类型</th>
                    <th>成本金额</th>
                    <th>成本月份</th>
                    <th>备注</th>
                </tr>
                @foreach($data as $v)
                    <tr>
                        <td>{{$v->id}}</td>
                        <td>{{$v->type}}</td>
                        <td>{{$v->amount}}</td>
                        <td>{{$v->date}}</td>
                        <td>{{$v->remark}}</td>
                    </tr>
                @endforeach
            </table>
            {{ $data->links() }}
        </div>

    </div>
    <script>
        // 添加成本
      $(".add_costing").on("click", function () {
        layer.open({
          type: 2,
          skin: 'layui-layer-rim', //加上边框
          area: ['750px', '650px'], //宽高
          content: '{{url('/admin/addCost')}}',
          end: function () {
            window.location.reload();
          }
        });
      });
    </script>
@endsection